package top.xunfong.file.service;


import top.xunfong.file.domain.dto.BreakpointDTO;
import top.xunfong.file.domain.vo.BreakpointCheckVO;
import top.xunfong.file.domain.vo.BreakpointMergeVO;
import top.xunfong.file.domain.vo.FileVO;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

public interface FileService {
    /**
     * 文件上传
     *
     * @param file
     * @return
     * @throws IOException
     */
    FileVO upload(MultipartFile file) throws IOException;

    /**
     * 创建断点续传任务
     *
     * @param dto
     * @return
     */

    void breakpoint(BreakpointDTO dto, MultipartFile file) throws IOException;

    BreakpointCheckVO breakpointCheck(BreakpointDTO dto);

    BreakpointMergeVO breakpointComplete(BreakpointDTO dto);

    /**
     * 通过MD5值删除文件
     *
     * @param md5
     */
    void deleteFileByMd5(String md5);
}
